var aDiv = document.querySelectorAll("div");
var aP = document.querySelectorAll("p");
var aSpan = document.querySelectorAll(".icon");

for (var i = 0; i < aDiv.length; i++) {
  aDiv[i].index = i;
  aDiv[i].onclick = function () {
    if (aP[this.index].style.display == "none") {
      aP[this.index].style.display = "block";
      aSpan[this.index].innerHTML = " - ";

    } else {
      aP[this.index].style.display = "none";
      aSpan[this.index].innerHTML = " + ";
    }
  }
}